using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._3DAnalystTools._TerrainDataset._Conversion
{
    /// <summary>
    /// <para>Terrain To TIN</para>
    /// <para>Converts a terrain dataset to a triangulated irregular network (TIN) dataset.</para>
    /// <para>将地形数据集转换为三角不规则网络 （TIN） 数据集。</para>
    /// </summary>    
    [DisplayName("Terrain To TIN")]
    public class TerrainToTin : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public TerrainToTin()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_terrain">
        /// <para>Input Terrain</para>
        /// <para>The terrain dataset to process.</para>
        /// <para>要处理的 terrain 数据集。</para>
        /// </param>
        /// <param name="_out_tin">
        /// <para>Output TIN</para>
        /// <para>The TIN dataset that will be generated.</para>
        /// <para>将生成的 TIN 数据集。</para>
        /// </param>
        public TerrainToTin(object _in_terrain, object _out_tin)
        {
            this._in_terrain = _in_terrain;
            this._out_tin = _out_tin;
        }
        public override string ToolboxName => "3D Analyst Tools";

        public override string ToolName => "Terrain To TIN";

        public override string CallName => "3d.TerrainToTin";

        public override List<string> AcceptEnvironments => ["extent", "geographicTransformations", "outputCoordinateSystem", "scratchWorkspace", "terrainMemoryUsage", "tinSaveVersion", "workspace"];

        public override object[] ParameterInfo => [_in_terrain, _out_tin, _pyramid_level_resolution, _max_nodes, _clip_to_extent.GetGPValue()];

        /// <summary>
        /// <para>Input Terrain</para>
        /// <para>The terrain dataset to process.</para>
        /// <para>要处理的 terrain 数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Terrain")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_terrain { get; set; }


        /// <summary>
        /// <para>Output TIN</para>
        /// <para>The TIN dataset that will be generated.</para>
        /// <para>将生成的 TIN 数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output TIN")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_tin { get; set; }


        /// <summary>
        /// <para>Pyramid Level Resolution</para>
        /// <para>The z-tolerance or window-size resolution of the terrain pyramid level that will be used. The default is 0, or full resolution.</para>
        /// <para>将使用的地形金字塔级别的 z 容差或窗口大小分辨率。默认值为 0，即全分辨率。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Pyramid Level Resolution")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _pyramid_level_resolution { get; set; } = 0;


        /// <summary>
        /// <para>Maximum Number of Nodes</para>
        /// <para>The maximum number of nodes permitted in the output TIN. The tool will return an error if the analysis extent and pyramid level would produce a TIN that exceeds this size. The default is 5 million.</para>
        /// <para>输出 TIN 中允许的最大节点数。如果分析范围和金字塔级别产生的 TIN 超过此大小，则该工具将返回错误。默认值为 500 万。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Number of Nodes")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _max_nodes { get; set; } = 5000000;


        /// <summary>
        /// <para>Clip to Extent</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the resulting TIN will be clipped against the analysis extent. This only has an effect if the analysis extent is defined and it's smaller than the extent of the input terrain.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Clips the output TIN against the analysis extent. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Does not clip the output TIN against the analysis extent.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否针对分析范围裁剪生成的 TIN。仅当定义了分析范围且其小于输入地形的范围时，这才有效。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 （Checked） - 根据分析范围裁剪输出 TIN。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不根据分析范围裁剪输出 TIN。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Clip to Extent")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _clip_to_extent_value _clip_to_extent { get; set; } = _clip_to_extent_value._true;

        public enum _clip_to_extent_value
        {
            /// <summary>
            /// <para>CLIP</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CLIP")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_CLIP</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_CLIP")]
            [GPEnumValue("false")]
            _false,

        }

        public TerrainToTin SetEnv(object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object terrainMemoryUsage = null, object tinSaveVersion = null, object workspace = null)
        {
            base.SetEnv(extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, terrainMemoryUsage: terrainMemoryUsage, tinSaveVersion: tinSaveVersion, workspace: workspace);
            return this;
        }

    }

}